//
//  ApiResponse.m
//  MyFrameWork
//
//  Created by eason on 16/4/25.
//  Copyright © 2016年 普惠. All rights reserved.
//

#import "ApiResponse.h"

@implementation ApiResponse

- (instancetype)initWithAttributes:(NSDictionary *)attributes
{
    self = [super init];
    if (self && attributes) {
        self.flag = [[attributes valueForKey:@"flag"] intValue];
        self.msgcode = [[attributes valueForKey:@"msgcode"] intValue];
        self.msg = [attributes valueForKey:@"msg"];
        self.response = [attributes valueForKey:@"response"];
    }
    return self;
}

- (void)resolveResponse:(id<IResponse>)resolveObj
{
    [resolveObj resolveWithAttributes:self.response];
    self.responseObj = resolveObj;
}

@end
